﻿* Encoding: UTF-8.
* Election pledges in multiparty governments: When do voters accept non-fulfillment?
    
* Replication code for the principal component analyses reported in the Supplementary Material (Tables S3 and S4).

* FINLAND

* Import the Finnish dataset (please change the file path to where you have saved the data file).
GET DATA
  /TYPE=XLSX
  /FILE='\\utuhome.utu.fi\jtylis\pledges-code-and-data\data_fin_wide.xlsx'
  /SHEET=name 'Sheet1'
  /CELLRANGE=FULL
  /READNAMES=ON
  /DATATYPEMIN PERCENTAGE=95.0
  /HIDDEN IGNORE=YES.
EXECUTE.
DATASET NAME data_fin_wide WINDOW=FRONT.

* Exclude non-citizens and those who did not complete the survey.
DATASET ACTIVATE data_fin_wide.
USE ALL.
COMPUTE filter_$=(citizenship = 1 AND Finished = 2).
VARIABLE LABELS filter_$ 'citizenship = 1 AND Finished = 2 (FILTER)'.
VALUE LABELS filter_$ 0 'Not Selected' 1 'Selected'.
FORMATS filter_$ (f1.0).
FILTER BY filter_$.
EXECUTE.

* Run a principal component analysis.
FACTOR
  /VARIABLES opinion_1 opinion_2 opinion_3 opinion_4 opinion_5 opinion_6
  /MISSING LISTWISE 
  /ANALYSIS opinion_1 opinion_2 opinion_3 opinion_4 opinion_5 opinion_6
  /PRINT INITIAL KMO EXTRACTION ROTATION
  /CRITERIA MINEIGEN(1) ITERATE(25)
  /EXTRACTION PC
  /CRITERIA ITERATE(25)
  /ROTATION VARIMAX
  /METHOD=CORRELATION.

* GERMANY

* Import the German dataset.
GET DATA
  /TYPE=XLSX
  /FILE='\\utuhome.utu.fi\jtylis\pledges-code-and-data\data_ger_wide.xlsx'
  /SHEET=name 'Sheet1'
  /CELLRANGE=FULL
  /READNAMES=ON
  /DATATYPEMIN PERCENTAGE=95.0
  /HIDDEN IGNORE=YES.
EXECUTE.
DATASET NAME data_ger_wide WINDOW=FRONT.

* Run a principal component analysis.
DATASET ACTIVATE data_ger_wide.
FACTOR
  /VARIABLES opinion_1 opinion_2 opinion_3 opinion_4 opinion_5 opinion_6
  /MISSING LISTWISE 
  /ANALYSIS opinion_1 opinion_2 opinion_3 opinion_4 opinion_5 opinion_6
  /PRINT INITIAL KMO EXTRACTION ROTATION
  /CRITERIA MINEIGEN(1) ITERATE(25)
  /EXTRACTION PC
  /CRITERIA ITERATE(25)
  /ROTATION VARIMAX
  /METHOD=CORRELATION.
